/**
  \file WinDllMain.cpp
  \date 02 march 2012
  \author Francis Girard
  
  Windows Dll Standard entry point
  
  Should be compiled in the library only under Windows of course.
*/

/*
 *  Copyright (C) 2012, Francis Girard
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifdef WIN32

#include <windows.h>

/**
  Dll main entry point.
*/
BOOLEAN WINAPI DllMain
(
  __in HINSTANCE hDllHandle,
  __in DWORD nReason,
  __in LPVOID Reserved
)
{
  BOOLEAN bSuccess = TRUE;
  
  //  Perform global initialization.
  switch ( nReason )
  {
    case DLL_PROCESS_ATTACH:
      //
      // For optimization.
      // Do not call this function from a DLL that is linked to the static
      // C run-time library (CRT). The static CRT requires DLL_THREAD_ATTACH and
      // DLL_THREAD_DETATCH notifications to function properly.
      //
      // Okay we won't ...
      //
      //DisableThreadLibraryCalls( hDllHandle );
      break;
    
    case DLL_PROCESS_DETACH:
      break;
   }
  
  //  Perform type-specific initialization.
  // ...
  
  return bSuccess;
  
}
//  end DllMain

// #ifdef WIN32
#endif

